﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace KonachanChanger.Forms
{
    public partial class PropertyForm : Form
    {
        public PropertyForm(object o) : base()
        {
            InitializeComponent();
            propertyGrid1.SelectedObject = o;
            this.Text = o.ToString();
        }
        new Form Parent;
        public PropertyForm(object o, Form Parent) : this(o)
        {
            this.Parent = Parent;
            Point p = Parent.DesktopLocation;
            p.X += Parent.Width;
            SetDesktopLocation(p.X, p.Y);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
            Parent.Move += new EventHandler(Parent_Move);
            Parent.Resize += new EventHandler(Parent_Move);
        }
        
        void Parent_Move(object sender, EventArgs e)
        {
            Point p = Parent.DesktopLocation;
            p.X += Parent.Width;
            SetDesktopLocation(p.X, p.Y);
        }
    }
}
